home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
DB_CLIPP
/
2510.ZIP
/
TRSOURCE.EXE
/
_TR_ASCP.ASM
next >
Wrap
Assembly Source File
|
1990-10-22
|
2KB
|
60 lines
; _TR_ASCP.ASM
;
; by Ralph Davis, Leonard Zerman
;
; Placed in the public domain by Tom Rettig Associates, 10/22/1990.
;
PUBLIC __TR_ASCPRINT
;*************************************
_TR_ASCP_TEXT SEGMENT BYTE PUBLIC 'CODE'
ASSUME CS:_TR_ASCP_TEXT
;-------------------------------------
;
; SYNTAX: _tr_ascprint(c);
;
; void _tr_ascprint();
; char c;
;
; Prints character c a la DEBUG as follows:
;
; Less than ' ' (ASCII 20H) prints as '.'
;
; Greater than ASCII 7FH: ANDs off high bit
;---------------------------------------------
__TR_ASCPRINT PROC FAR
PUSH BP ; Save caller's BP
MOV BP,SP ; Address stack through BP
PUSH AX ; Save other registers
PUSH DX
PRINT_CHAR:
MOV DL,[BP+6] ; Pick up character to display
CMP DL,255 ; Is it CHR(255)?
JE PRINT_DOT ; Yes, print a '.'
CMP DL,128 ; Is it extended ASCII code (>= 128)?
JB IS_SPACE ; No, is it space or less?
AND DL,7FH ; Greater than 127, AND off high bit
IS_SPACE:
CMP DL,' ' ; Is character printable ASCII
; (space or greater)?
JB PRINT_DOT ; No, print a '.'
MOV AH,2 ; Yes, print the character
INT 21H
JMP SHORT EXIT
PRINT_DOT:
MOV DL,'.' ; Print a '.'
MOV AH,2
INT 21H
EXIT:
POP DX ; Restore registers
POP AX
POP BP
RET
__TR_ASCPRINT ENDP
;--------------------------------------------
_TR_ASCP_TEXT ENDS
;********************************************
END